<!DOCTYPE html>
<html lang="en">
<head>
	<include data="head.html">
	<title>仪表盘: {@$_GET['action'] == 'register' ? '注册' : '登录'}</title>
	<style>
	.panel-body{box-shadow: none;}
	.panel-footer{padding: 0 15px 10px;background-color: transparent;border-top: none;border-radius: 0;}
	.panel-login{padding: 0;width: 320px !important;padding: 0 !important;border: none;box-shadow: 0 1px 1px rgba(0,0,0,.05) !important;}
	.panel-login .checkbox{display: inline-block;}
	.panel-login button[type=submit]{float: right;}
	#email-vcode, #vcode-img{margin-top: -49px;float: right;cursor: pointer;}
	#vcode{padding-right: 104px;float: left;margin-bottom: 15px;}
	#user_password+i.glyphicon{float: right;margin-top: -24px;margin-right: 10px;}
	</style>
</head>
<body>
	<div class="panel-container">
		<div class="panel panel-default panel-login" style="display: none;">
			<if data="@$_GET['action'] == 'register'">
				<if data="!config('user.register.enable')">
					<redirect data="{ADMIN_URL}login.html, 302, 2, 用户注册已关闭。">
					<else>
						<div class="panel-heading">
							<h4 class="panel-title">注册新用户
								<a href="login.html"><small>返回登录</small></a>
							</h4>
						</div>
						<div class="panel-body">
							<form role="form" action="{site_url('mod.php?user::add')}" method="post">
								<div class="form-group">
									<label for="user_name">用户名：</label>
									<input type="text" class="form-control" id="user_name" name="user_name" placeholder="用户名" required>
								</div>
								<div class="form-group">
									<label for="user_password">密码：</label>
									<input type="password" class="form-control" id="user_password" name="user_password" placeholder="登录密码" required>
									<if data="!is_agent('Edge/14')">
										<i class="glyphicon glyphicon-eye-open"></i>
									</if>
								</div>
								<div class="form-group">
									<label for="user_email">邮箱：</label>
									<input type="email" class="form-control" id="user_email" name="user_email" placeholder="电子邮箱" required>
								</div>
								<if data="config('user.register.verify')">
									<div class="form-group">
										<label for="vcode">验证码：</label>
										<input type="text" class="form-control" id="vcode" name="vcode" placeholder="验证码" required>
										<if data="config('user.register.verify') == 'email'">
											<a role="button" id="email-vcode" class="btn btn-default{$mailSvr == false ? ' disabled' : ''}" title="{$mailSvr == false ? $mailWarning : ''}" data-action="注册" data-loading-text="正在发送...">发送验证码</a>
											<elseif data="config('user.register.verify') == 'vcode'">
												<img id="vcode-img" src="{ADMIN_URL}vcode.php" alt="验证码" title="点击更换">
											</elseif>
										</if>
									</div>
								</if>
								<button type="submit" class="btn btn-success" data-loading-text="加载中...">注册</button>
							</form>
						</div>
					</else>
				</if>
				<elseif data="@$_GET['action'] == 'repass'">
					<div class="panel-heading">
						<h4 class="panel-title">找回密码
							<a href="login.html"><small>返回登录</small></a>
						</h4>
					</div>
					<div class="panel-body">
						<if data="config('user.password.recoverEmail') == 'link'">
							<if data="!$confirmRepass">
								<if data="$invalidRecoverId">
									<p>链接已过期，请重新发送找回密码邮件。</p>
								</if>
								<form role="form" action="{site_url('mod.php?user::mailRepass')}" method="post">
									<div class="form-group">
										<label for="user_email">邮箱：</label>
										<input type="email" class="form-control" id="user_email" name="user_email" placeholder="你所绑定的电子邮件地址" required>
									</div>
									<button type="submit" class="btn btn-success{$mailSvr == false ? ' disabled' : ''}" title="{$mailSvr == false ? $mailWarning : ''}" data-loading-text="加载中...">发送邮件</button>
								</form>
								<else>
									<form role="form" action="{site_url('mod.php?user::recoverPassword')}" method="post">
										<input type="hidden" name="user_id" value="{user_id()}">
										<input type="hidden" name="RecoverId" value="{$_GET['RecoverId']}">
										<p>尊敬的 {user_nickname() ?: user_name()}，你正在重新设置登录密码：</p>
										<div class="form-group">
											<label for="user_password">新密码：</label>
											<input type="password" class="form-control" id="user_password" name="user_password" placeholder="新密码" required>
											<if data="!is_agent('Edge/14')">
												<i class="glyphicon glyphicon-eye-open"></i>
											</if>
										</div>
										<button type="submit" class="btn btn-success" data-loading-text="加载中...">修改密码</button>
									</form>
								</else>
							</if>
							<elseif data="config('user.password.recoverEmail') == 'vcode'">
								<form role="form" action="{site_url('mod.php?user::recoverPassword')}" method="post">
									<div class="form-group">
										<label for="user_email">邮箱：</label>
										<input type="email" class="form-control" id="user_email" name="user_email" placeholder="你所绑定的电子邮件地址" required>
									</div>
									<div class="form-group">
										<label for="user_password">新密码：</label>
										<input type="password" class="form-control" id="user_password" name="user_password" placeholder="新密码" required>
										<if data="!is_agent('Edge/14')">
											<i class="glyphicon glyphicon-eye-open"></i>
										</if>
									</div>
									<if data="config('user.register.verify')">
										<div class="form-group">
											<label for="vcode">验证码：</label>
											<input type="text" class="form-control" id="vcode" name="vcode" placeholder="验证码" required>
											<a role="button" id="email-vcode" class="btn btn-default{$mailSvr == false ? ' disabled' : ''}" title="{$mailSvr == false ? $mailWarning : ''}" data-action="找回密码" data-loading-text="正在发送...">发送验证码</a>
										</div>
									</if>
									<button type="submit" class="btn btn-success" data-loading-text="加载中...">修改密码</button>
								</form>
							</elseif>
							<else>
								<redirect data="{ADMIN_URL}login.html, 302, 2, 找回密码功能已关闭。">
							</else>
						</if>
					</div>
				</elseif>
				<else>
					<!-- 登录 -->
					<div class="panel-heading">
						<h4 class="panel-title">登录
							<if data="config('user.register.enable')">
								<a href="?action=register"><small>注册</small></a>
							</if>
						</h4>
					</div>
					<div class="panel-body">
						<form role="form" action="{site_url('mod.php?user::login')}" method="post">
							<div class="form-group">
								<label for="user">账户：</label>
								<input type="text" class="form-control" id="user" {$attr} required>
							</div>
							<div class="form-group">
								<label for="user_password">密码：</label>
								<input type="password" class="form-control" id="user_password" name="user_password" placeholder="登录密码">
								<if data="!is_agent('Edge/14')">
									<i class="glyphicon glyphicon-eye-open"></i>
								</if>
							</div>
							<div class="checkbox">
								<label class="checkbox-inline">
									<input type="checkbox" name="remember_me"> 保持登录
								</label>
							</div>
							<button type="submit" id="login-button" class="btn btn-success" data-loading-text="加载中...">登录</button>
						</form>
					</div>
				</else>
			</if>
			<div class="panel-footer">
				<a href="{site_url()}" title="返回网站首页">返回主页</a>
				<if data="empty($_GET['action'])">
					<a style="float: right" href="login.html?action=repass">找回密码</a>
				</if>
			</div>
		</div>
	</div>
	<include data="foot.html">
	<import data="js/jquery.centralize.js">
</body>
</html>